Skip to content

feat: add make sbom / install-sbom / uninstall-sbom targets#258

Open
MarkAtwood wants to merge 2 commits into
wolfSSL:mainfrom
MarkAtwood:feat/add-make-sbom
Open

feat: add make sbom / install-sbom / uninstall-sbom targets#258
MarkAtwood wants to merge 2 commits into
wolfSSL:mainfrom
MarkAtwood:feat/add-make-sbom

Conversation

@MarkAtwood

Copy link
Copy Markdown

Summary

  • Adds make sbom, make install-sbom, and make uninstall-sbom targets to wolfCLU's autotools build for EU CRA compliance evidence (CycloneDX 1.6 + SPDX 2.3 output)
  • Adds AC_CHECK_PROG checks for python3 and pyspdxtools in configure.ac

Usage

make sbom WOLFSSL_DIR=/path/to/wolfssl
# produces: wolfclu-0.2.0.cdx.json  wolfclu-0.2.0.spdx.json  wolfclu-0.2.0.spdx
pyspdxtools --infile wolfclu-0.2.0.spdx.json   # must pass

make install-sbom   # installs to $(datadir)/doc/wolfclu/
make uninstall-sbom

WOLFSSL_DIR must point to a wolfssl checkout containing scripts/gen-sbom (branch feat/sbom-embedded, or master once wolfSSL/wolfssl#10343 merges).

Notes

  • wolfCLU installs a binary (wolfssl), not a shared library — artifact hash uses --srcs $(wolfssl_SOURCES) (the compiled .c source list) rather than --lib; no staging step needed
  • Version read from CLUWOLFSSL_VERSION_STRING in wolfclu/version.h (the #define VERSION 0.3 in clu_header_main.h is stale and ignored)
  • WOLFSSL_INCLUDEDIR defaults to $(WOLFSSL_DIR)/include; wolfssl's options.h is used for the config source since wolfCLU has no generated options header of its own
  • uninstall-hook dependency ensures make uninstall removes SBOM files

Adds CycloneDX + SPDX SBOM generation via wolfssl's gen-sbom script.
Usage: make sbom WOLFSSL_DIR=/path/to/wolfssl

wolfCLU is a binary (not .so); artifact hash uses --srcs from
wolfssl_SOURCES. Version from CLUWOLFSSL_VERSION_STRING in version.h.
Copilot AI review requested due to automatic review settings June 23, 2026 22:35
@MarkAtwood MarkAtwood requested a review from sameehj June 23, 2026 22:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds SBOM (CycloneDX + SPDX) generation and installation/uninstallation targets to the autotools build, along with configure-time discovery of required tooling, to support compliance/evidence needs.

Changes:

  • Adds make sbom, make install-sbom, make uninstall-sbom targets that generate SBOM artifacts and install/remove them under $(datadir)/doc/wolfclu/.
  • Introduces configure.ac checks for python3 and pyspdxtools intended to support the SBOM generation flow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Makefile.am Adds SBOM targets and wiring for generation + install/uninstall.
configure.ac Adds configure-time tool detection for SBOM prerequisites.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile.am
Comment on lines +170 to +184
WOLFSSL_DIR ?=
PRODUCT = wolfclu
VERSION = $(shell grep CLUWOLFSSL_VERSION_STRING $(srcdir)/wolfclu/version.h 2>/dev/null | sed 's/.*"\(.*\)".*/\1/')
GEN_SBOM = $(WOLFSSL_DIR)/scripts/gen-sbom
WOLFSSL_INCLUDEDIR ?= $(WOLFSSL_DIR)/include
SBOM_OPTS = --name $(PRODUCT) \
--version $(VERSION) \
--supplier "wolfSSL Inc." \
--options-h $(WOLFSSL_INCLUDEDIR)/wolfssl/options.h \
--srcs $(addprefix $(srcdir)/,$(wolfssl_SOURCES))

SBOM_OUT_DIR = $(builddir)
SBOM_CDX = $(SBOM_OUT_DIR)/$(PRODUCT)-$(VERSION).cdx.json
SBOM_SPDX_J = $(SBOM_OUT_DIR)/$(PRODUCT)-$(VERSION).spdx.json
SBOM_SPDX_TV = $(SBOM_OUT_DIR)/$(PRODUCT)-$(VERSION).spdx
Comment thread Makefile.am
Comment on lines +188 to +195
sbom: all
@if test -z "$(WOLFSSL_DIR)"; then \
echo "ERROR: WOLFSSL_DIR not set. Usage: make sbom WOLFSSL_DIR=/path/to/wolfssl"; \
exit 1; \
fi
@if test -z "$(PYTHON3)"; then echo "ERROR: python3 not found in PATH."; exit 1; fi
$(PYTHON3) $(GEN_SBOM) $(SBOM_OPTS)

Comment thread configure.ac
Comment on lines +62 to +65
# SBOM generation prerequisites
AC_CHECK_PROG([PYTHON3], [python3], [python3])
AC_CHECK_PROG([PYSPDXTOOLS], [pyspdxtools], [pyspdxtools])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants